<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>32_属性-遍历</title>
    </head>
    <body>
        <script>
            var person = {name:'zs',age:18,gender:'男'};

            for(x in person){
                // 遍历的是属性名字
                // console.log(x);

                // 遍历的属性值
                // console.log(person[x]);

                // 遍历属性名字和属性值
                console.log(x,person[x]);
            }
        </script>
    </body>
</html>